import { _ as _async_to_generator } from "@swc/helpers/_/_async_to_generator";
import { _ as _define_property } from "@swc/helpers/_/_define_property";
import { _ as _object_spread } from "@swc/helpers/_/_object_spread";
import { _ as _object_spread_props } from "@swc/helpers/_/_object_spread_props";
import { _ as _sliced_to_array } from "@swc/helpers/_/_sliced_to_array";
import { _ as _ts_generator } from "@swc/helpers/_/_ts_generator";
import _Slide from "@mui/material/Slide";
import _Collapse from "@mui/material/Collapse";
import _useMediaQuery from "@mui/material/useMediaQuery";
import React, { useMemo, useRef, useState } from "react";
import classes from "./nftDetail.module.less";
import { useLatest, useMount, useReactive, useUnmount } from "ahooks";
import { getNFTInfo, getNFTQRCode, getNFTInfoV2, requestSubmitGuide, requestGuideHistory } from "../../api/wallet";
import useServices from "../../hooks/useRequest";
import classNames from "classnames";
import utilsFilter from "../../utils/filters";
import { getMapFinalValue, getChainName, getSpec, matchTheme, formateDate, dateCompare, getNFTBrowser, walletRootRef } from "../../utils";
import SecondaryLayout from "../../compoents/secondary-layout";
import SendNft from "./send-nft";
import { TransitionGroup } from "react-transition-group";
import Config from "../../config";
import { useDispatch, useSelector } from "react-redux";
import { useClipboard } from "use-clipboard-copy";
import toast from "../../compoents/toast";
import { useTranslation } from "react-i18next";
import { LocalKeyMap } from "../../local";
import { QRCodeSVG } from "qrcode.react";
import { getEventInfo } from "../../api/common";
import useRouter from "../../hooks/useRouter";
import usePolling from "../../hooks/usePolling";
import EventCard from "../common/event-card";
import Guide from "./guide";
import { jsx as _jsx } from "react/jsx-runtime";
import { jsxs as _jsxs } from "react/jsx-runtime";
var formatEventDate = function(date) {
    return formateDate(date, "YYYY/MM/DD");
};
// 二维码弹窗
var UtilityQR = function(props) {
    var isPc = _useMediaQuery("(min-width:1280px)");
    return /*#__PURE__*/ _jsxs("div", {
        className: classes.qr_toast_wrap,
        children: [
            /*#__PURE__*/ _jsx("div", {
                className: classes.qr_toast,
                children: /*#__PURE__*/ _jsx("div", {
                    className: classes.qr_container,
                    children: /*#__PURE__*/ _jsx(QRCodeSVG, {
                        value: props.qrContent,
                        className: classes.qr_code,
                        level: "M",
                        bgColor: "transparent",
                        fgColor: "#4F48E2",
                        imageSettings: {
                            src: require("../../assets/icons/qrLogo.svg"),
                            x: undefined,
                            y: undefined,
                            width: 35,
                            height: 35,
                            excavate: true
                        }
                    })
                })
            }),
            /*#__PURE__*/ _jsxs("div", {
                className: classes.qr_arrow_wrap,
                children: [
                    /*#__PURE__*/ _jsx("div", {
                        className: classes.qr_arrow_place
                    }),
                    /*#__PURE__*/ _jsx("div", {
                        className: classes.qr_arrow,
                        onClick: props.onClose,
                        children: /*#__PURE__*/ _jsx("img", {
                            src: require("./images/arrar.jpg")
                        })
                    })
                ]
            })
        ]
    });
};
// blockchain 弹窗
var BlockChainDetails = function(props) {
    var t = useTranslation().t;
    var copy = useClipboard({
        onSuccess: function() {
            toast.copy();
        },
        onError: function() {
            toast.createToast({
                type: "errToast",
                message: t(LocalKeyMap["toast.error.copy"])
            });
        }
    }).copy;
    return /*#__PURE__*/ _jsxs("div", {
        className: classes.block_chain_details,
        children: [
            /*#__PURE__*/ _jsxs("div", {
                className: classes.block_chain_container,
                children: [
                    /*#__PURE__*/ _jsx("div", {
                        className: classes.block_chain_title,
                        children: "BLOCKCHAIN DETAILS"
                    }),
                    /*#__PURE__*/ _jsxs("div", {
                        className: classes.list,
                        children: [
                            /*#__PURE__*/ _jsxs("div", {
                                className: classes.item,
                                children: [
                                    /*#__PURE__*/ _jsx("span", {
                                        children: t(LocalKeyMap.tokenStandard)
                                    }),
                                    /*#__PURE__*/ _jsxs("span", {
                                        children: [
                                            /*#__PURE__*/ _jsx("img", {
                                                className: classes.little_icon,
                                                src: getMapFinalValue([
                                                    getChainName(props.chainType)
                                                ], {
                                                    BSC: require("../../assets/icons/bscPrimary.svg"),
                                                    ETHEREUM: require("../../assets/icons/ethPrimary.svg"),
                                                    CONFLUX: require("../../assets/icons/confluxPrimary.svg")
                                                })
                                            }),
                                            getSpec(props.chainType, props.spec)
                                        ]
                                    })
                                ]
                            }),
                            /*#__PURE__*/ _jsxs("div", {
                                className: classes.item,
                                children: [
                                    /*#__PURE__*/ _jsx("span", {
                                        children: t(LocalKeyMap.tokenID)
                                    }),
                                    /*#__PURE__*/ _jsx("span", {
                                        children: props.tokenId
                                    })
                                ]
                            }),
                            /*#__PURE__*/ _jsxs("div", {
                                className: classes.item,
                                children: [
                                    /*#__PURE__*/ _jsx("span", {
                                        children: t(LocalKeyMap.contractAddress)
                                    }),
                                    /*#__PURE__*/ _jsxs("span", {
                                        onClick: function() {
                                            return copy(props.contract);
                                        },
                                        children: [
                                            utilsFilter.stringMethod(props.contract),
                                            /*#__PURE__*/ _jsx("img", {
                                                className: classes.item_icon,
                                                src: matchTheme("light", {
                                                    dark: require("../../assets/icons/dark/copy.svg"),
                                                    light: require("../../assets/icons/copy.svg")
                                                })
                                            })
                                        ]
                                    })
                                ]
                            })
                        ]
                    }),
                    props.contract && props.tokenId && /*#__PURE__*/ _jsx("div", {
                        className: classes.scan_foot,
                        onClick: function() {
                            window.open(getNFTBrowser(props.chainType || "", props.contract, props.tokenId));
                        },
                        children: "View On Blockchain Scan"
                    })
                ]
            }),
            /*#__PURE__*/ _jsx("img", {
                className: classes.block_chain_close,
                onClick: props.onClose,
                src: require("../../assets/icons/clear.svg")
            })
        ]
    });
};
var DetailCollapse = function(props) {
    var _useState = _sliced_to_array(useState(true), 2), open = _useState[0], setOpen = _useState[1];
    var isPc = _useMediaQuery("(min-width:1280px)");
    var theme = useSelector(function(state) {
        return state.app.theme;
    });
    var size = useMemo(function() {
        if (isPc) return 20;
        return window.innerWidth / 375 * 16;
    }, [
        isPc
    ]);
    return /*#__PURE__*/ _jsx(_Collapse, {
        in: open,
        collapsedSize: size,
        className: props.className,
        children: /*#__PURE__*/ _jsxs("div", {
            className: classes.collapse,
            children: [
                /*#__PURE__*/ _jsxs("div", {
                    className: classes.collapse_title,
                    children: [
                        props.title,
                        /*#__PURE__*/ _jsx("img", {
                            className: classNames(classes.collapse_icon, !open ? classes.collapse_icon_open : ""),
                            src: matchTheme(theme, {
                                dark: require("../../assets/icons/dark/topArrow.svg"),
                                light: require("../../assets/icons/light/topArrow.svg")
                            }),
                            onClick: function() {
                                return setOpen(!open);
                            }
                        })
                    ]
                }),
                props.children
            ]
        })
    });
};
function NftDetail(originProps) {
    var _state_events, _state_detail, _state_events1;
    /** 路由传递过来的信息 */ var query = useRouter().query;
    var _useState = _sliced_to_array(useState(false), 2), guideVisible = _useState[0], setGuideVisible = _useState[1];
    /** 路由传递过来的信息混合着props里 */ var props = _object_spread({}, originProps, query);
    var lastProps = useLatest(props);
    var state = useReactive({
        id: props.id,
        detail: {
            id: props.id,
            name: props.name
        },
        events: [],
        eventsType: "today",
        eventsClickedType: false,
        type: "img",
        inputPage: false
    });
    var _useState1 = _sliced_to_array(useState(false), 2), qrOpen = _useState1[0], setQROpen = _useState1[1];
    var eventList = useMemo(function() {
        var _state_events;
        if (!state.events || ((_state_events = state.events) === null || _state_events === void 0 ? void 0 : _state_events.length) === 0) return [];
        var _eventsClickedType = state.eventsClickedType;
        var _events = state.events;
        if (state.eventsType == "today") {
            var todayList = (_events || []).filter(function(ev) {
                return dateCompare.isBetween(ev.currentTime, ev.startTime, ev.endTime, "m", "[]");
            });
            // 如果event中没有今日的，则自动切换至即将到来
            if (todayList.length === 0 && _eventsClickedType === false) {
                state.eventsType = "upcoming";
            }
            return todayList;
        } else if (state.eventsType = "upcoming") {
            var upcomingList = (_events || []).filter(function(ev) {
                return dateCompare.isBefore(ev.currentTime, ev.startTime, "m");
            });
            // 如果event中没有即将到来的的，则自动切换至今日，回复默认today选中
            if (upcomingList.length === 0 && _eventsClickedType === false) {
                state.eventsType = "today";
            }
            return upcomingList;
        }
    }, [
        state.eventsType,
        (_state_events = state.events) === null || _state_events === void 0 ? void 0 : _state_events.length,
        state.eventsClickedType
    ]);
    var hasCode = eventList.some(function(obj) {
        return obj.hasOwnProperty("code");
    });
    var theme = useSelector(function(rootState) {
        return rootState.app.theme;
    });
    var userInfo = useSelector(function(rootState) {
        return rootState.app.userInfo;
    });
    var dispatch = useDispatch();
    var t = useTranslation().t;
    // const { getNftImgSrc } = useCalculateAmount();
    var copy = useClipboard({
        onSuccess: function() {
            toast.copy();
        },
        onError: function() {
            toast.createToast({
                type: "errToast",
                message: t(LocalKeyMap["toast.error.copy"])
            });
        }
    }).copy;
    var imgBoxRef = useRef(null);
    var wrapRef = useRef(null);
    var descTextRef = useRef(null);
    /** 二维码弹窗 */ var QRModal = useRef(null);
    var services = useServices({
        getNFTInfo: getNFTInfo,
        getNFTInfoV2: getNFTInfoV2,
        getEventInfo: getEventInfo,
        getNFTQRCode: getNFTQRCode,
        requestSubmitGuide: requestSubmitGuide,
        requestGuideHistory: requestGuideHistory
    });
    var getGuideHistory = function() {
        var _ref = _async_to_generator(function() {
            var _ref, code, data, guideTypeCodeList, e;
            return _ts_generator(this, function(_state) {
                switch(_state.label){
                    case 0:
                        _state.trys.push([
                            0,
                            2,
                            ,
                            3
                        ]);
                        return [
                            4,
                            services.requestGuideHistory()
                        ];
                    case 1:
                        _ref = _state.sent(), code = _ref.code, data = _ref.data;
                        if (code === 200) {
                            guideTypeCodeList = (data === null || data === void 0 ? void 0 : data.guideTypeCodeList) || [];
                            if (guideTypeCodeList.includes("ona_nft_detail_guide")) {
                                setGuideVisible(false);
                            } else {
                                setGuideVisible(true);
                            }
                        }
                        return [
                            3,
                            3
                        ];
                    case 2:
                        e = _state.sent();
                        setGuideVisible(false);
                        return [
                            3,
                            3
                        ];
                    case 3:
                        return [
                            2
                        ];
                }
            });
        });
        return function getGuideHistory() {
            return _ref.apply(this, arguments);
        };
    }();
    var fetchInfo = function() {
        var _ref = _async_to_generator(function() {
            var _ref, code, data, e;
            return _ts_generator(this, function(_state) {
                switch(_state.label){
                    case 0:
                        _state.trys.push([
                            0,
                            2,
                            ,
                            3
                        ]);
                        return [
                            4,
                            services.getNFTInfoV2({
                                tokenId: props.tokenId,
                                type: props.type,
                                chainType: props.chainType,
                                contract: props.contract
                            })
                        ];
                    case 1:
                        _ref = _state.sent(), code = _ref.code, data = _ref.data;
                        if (code == 200) {
                            // debugger;
                            state.detail = data || {};
                            if (data.filePath.indexOf(".mp4") != -1 || data.filePath.indexOf(".flv") != -1 || data.filePath.indexOf(".m3u8") != -1) {
                                state.type = "video";
                            }
                            if (data.filePath.indexOf(".mp3") != -1) {
                                state.type = "audio";
                            }
                        }
                        return [
                            3,
                            3
                        ];
                    case 2:
                        e = _state.sent();
                        return [
                            3,
                            3
                        ];
                    case 3:
                        return [
                            2
                        ];
                }
            });
        });
        return function fetchInfo() {
            return _ref.apply(this, arguments);
        };
    }();
    var fetchEvent = function() {
        var _ref = _async_to_generator(function() {
            var _ref, code, data, e;
            return _ts_generator(this, function(_state) {
                switch(_state.label){
                    case 0:
                        _state.trys.push([
                            0,
                            2,
                            ,
                            3
                        ]);
                        return [
                            4,
                            services.getEventInfo({
                                tokenId: "".concat(props.tokenId),
                                contract: props.contract,
                                chainType: props.chainType
                            })
                        ];
                    case 1:
                        _ref = _state.sent(), code = _ref.code, data = _ref.data;
                        if (code == 200) {
                            state.events = data;
                        }
                        return [
                            3,
                            3
                        ];
                    case 2:
                        e = _state.sent();
                        return [
                            3,
                            3
                        ];
                    case 3:
                        return [
                            2
                        ];
                }
            });
        });
        return function fetchEvent() {
            return _ref.apply(this, arguments);
        };
    }();
    // const handlerScroll = useCallback((ev: MouseEvent) => {
    //   if()
    //   if(detailDom.current?.style.position==='fixed')
    // }, []);
    useMount(function() {
        fetchInfo();
        fetchEvent();
        getGuideHistory();
    // window.addEventListener("scroll", handlerScroll);
    });
    useUnmount(function() {
    // window.removeEventListener("scroll", handlerScroll);
    });
    /** 打开详情 */ var openBlockChainDetails = function() {
        var _ref = _async_to_generator(function() {
            var blockChainModal;
            return _ts_generator(this, function(_state) {
                blockChainModal = toast({
                    content: /*#__PURE__*/ _jsx(BlockChainDetails, _object_spread({
                        onClose: function() {
                            blockChainModal.destroy();
                        }
                    }, state.detail)),
                    duration: -1,
                    mask: true,
                    centered: true,
                    inner: true,
                    container: walletRootRef.current,
                    maskZIndex: 1401
                });
                return [
                    2
                ];
            });
        });
        return function openBlockChainDetails() {
            return _ref.apply(this, arguments);
        };
    }();
    var comingSoon = function() {
        toast({
            content: /*#__PURE__*/ _jsx("div", {
                className: classes.comingSoon,
                children: t(LocalKeyMap.comingSoon)
            }),
            duration: 2000,
            mask: false,
            centered: true,
            inner: true,
            container: walletRootRef.current,
            maskZIndex: 1401
        });
    };
    // 打开市场
    var openMarket = function() {
        comingSoon();
    };
    // 打开官网
    var openWWW = function() {
        comingSoon();
    // window.open(
    //   'https://sg.osim.com/',
    // );
    };
    /** 打开二维码 */ var openQR = function() {
        var _ref = _async_to_generator(function() {
            var qrContent, _ref, code, data, msg;
            return _ts_generator(this, function(_state) {
                switch(_state.label){
                    case 0:
                        qrContent = "".concat(window.location.protocol, "//").concat(Config.h5_domain, "/").concat(state.detail.chainType, "/").concat(state.detail.contract, "/").concat(state.detail.tokenId, "/").concat(props.type);
                        if (!(userInfo.id && state.detail.userId == userInfo.id)) return [
                            3,
                            2
                        ];
                        return [
                            4,
                            services.getNFTQRCode({
                                tokenId: props.tokenId,
                                type: props.type,
                                chainType: props.chainType,
                                contract: props.contract
                            })
                        ];
                    case 1:
                        _ref = _state.sent(), code = _ref.code, data = _ref.data, msg = _ref.msg;
                        if (code !== 200) {
                            toast.createToast({
                                type: "errToast",
                                message: msg
                            });
                            return [
                                2
                            ];
                        }
                        qrContent = "".concat(window.location.protocol, "//").concat(Config.h5_domain, "/").concat(data === null || data === void 0 ? void 0 : data.chainType, "/").concat(data === null || data === void 0 ? void 0 : data.contract, "/").concat(data === null || data === void 0 ? void 0 : data.tokenId, "/").concat(props.type).concat(data.sign ? "/".concat(data.sign) : "");
                        _state.label = 2;
                    case 2:
                        QRModal.current = toast({
                            content: /*#__PURE__*/ _jsx(UtilityQR, {
                                imgUrl: state.detail.logoUrl,
                                qrContent: qrContent,
                                onClose: stopQRLoop
                            }),
                            duration: -1,
                            mask: false,
                            centered: true,
                            inner: true,
                            container: imgBoxRef.current
                        });
                        setQROpen(true);
                        /** 登录情况才需要更新二维码 */ if (userInfo.id) {
                        /** 反复更新二维码 */ // setTimeout(() => {
                        //   updateQR(true);
                        // }, 1000 * 30);
                        }
                        return [
                            2
                        ];
                }
            });
        });
        return function openQR() {
            return _ref.apply(this, arguments);
        };
    }();
    /** 轮询更新二维码 */ var updateQR = function() {
        var _ref = _async_to_generator(function() {
            var loop;
            var _arguments = arguments;
            return _ts_generator(this, function(_state) {
                loop = _arguments.length > 0 && _arguments[0] !== void 0 ? _arguments[0] : false;
                services.getNFTQRCode({
                    tokenId: props.tokenId,
                    type: props.type,
                    chainType: props.chainType,
                    contract: props.contract
                }).then(function(res) {
                    if (res.code !== 200) {
                        throw res;
                    }
                    var data = res.data;
                    var newContent = "".concat(window.location.protocol, "//").concat(window.location.host, "/").concat(data === null || data === void 0 ? void 0 : data.chainType, "/").concat(data === null || data === void 0 ? void 0 : data.contract, "/").concat(data === null || data === void 0 ? void 0 : data.tokenId, "/").concat(props.type).concat(data.sign ? "/".concat(data.sign) : "");
                    QRModal.current.update({
                        content: /*#__PURE__*/ _jsx(UtilityQR, {
                            imgUrl: state.detail.logoUrl,
                            qrContent: newContent,
                            onClose: stopQRLoop
                        })
                    });
                }).catch(function(error) {});
                if (loop) {
                    run();
                }
                return [
                    2
                ];
            });
        });
        return function updateQR() {
            return _ref.apply(this, arguments);
        };
    }();
    var _usePolling = usePolling(updateQR, {
        pollingInterval: 1000 * 120,
        manual: true
    }), run = _usePolling.run, cancel = _usePolling.cancel;
    /** 停止更新二维码 */ var stopQRLoop = function() {
        var _QRModal_current, _QRModal_current_destroy;
        cancel();
        (_QRModal_current_destroy = (_QRModal_current = QRModal.current).destroy) === null || _QRModal_current_destroy === void 0 ? void 0 : _QRModal_current_destroy.call(_QRModal_current);
        setQROpen(false);
        QRModal.current = null;
    };
    var disabled = useMemo(function() {
        var _state_detail;
        return ((_state_detail = state.detail) === null || _state_detail === void 0 ? void 0 : _state_detail.status) === "staking";
    }, [
        (_state_detail = state.detail) === null || _state_detail === void 0 ? void 0 : _state_detail.status
    ]);
    var openSendPage = function() {
        if (!userInfo.id && userInfo.id !== state.detail.userId) return;
        if (disabled) {
            toast.createToast({
                type: "errToast",
                message: t(LocalKeyMap.transDisabled)
            });
            return;
        }
        // if (state.detail.createStatus !== 'Success') return;
        state.inputPage = true;
    };
    var goShare = function() {
        dispatch.app.PUSH({
            path: "/share",
            query: {
                from: "NFTS",
                NFTinfo: JSON.parse(JSON.stringify(state.detail))
            }
        });
    };
    var back = function() {
        state.inputPage = false;
    };
    var detailsBack = function() {
        if (props.onBack) {} else {
            dispatch.app.BACK();
        }
    };
    var _obj, _obj1;
    return /*#__PURE__*/ _jsxs(TransitionGroup, {
        className: classes.animation_wrap,
        children: [
            /*#__PURE__*/ _jsxs("div", {
                className: classNames(classes.view_port, state.inputPage ? classes.v_h : ""),
                children: [
                    /*#__PURE__*/ _jsx("div", {
                        onClick: detailsBack,
                        className: classes.close,
                        children: /*#__PURE__*/ _jsx("img", {
                            src: require("../../assets/icons/backLight.svg")
                        })
                    }),
                    /*#__PURE__*/ _jsx("div", {
                        ref: wrapRef,
                        className: classes["NFT_detail"],
                        children: /*#__PURE__*/ _jsxs("div", {
                            className: classes.NFT_detail_wrap,
                            children: [
                                /*#__PURE__*/ _jsxs("div", {
                                    className: "".concat(classes.imgBox),
                                    ref: imgBoxRef,
                                    children: [
                                        !qrOpen && /*#__PURE__*/ _jsx("div", {
                                            className: classes.img_qr,
                                            onClick: openQR,
                                            children: /*#__PURE__*/ _jsx("img", {
                                                src: require("../../assets/icons/qrTip.svg")
                                            })
                                        }),
                                        /*#__PURE__*/ _jsx("div", {
                                            className: classes.relative_name,
                                            children: /*#__PURE__*/ _jsx("span", {
                                                children: state.detail.name
                                            })
                                        }),
                                        state.type != "video" && /*#__PURE__*/ _jsx("img", {
                                            "v-if": "type != 'video'",
                                            className: classes.img,
                                            src: state.detail.logoUrl
                                        }),
                                        state.type == "video" && /*#__PURE__*/ _jsx("video", {
                                            "v-if": "type == 'video'",
                                            className: classes.img,
                                            poster: state.detail.logoUrl,
                                            src: state.detail.logoUrl,
                                            controls: true
                                        }),
                                        state.type == "audio" && /*#__PURE__*/ _jsx("div", {
                                            className: classNames(classes.audio),
                                            "v-if": "type == 'audio'",
                                            children: /*#__PURE__*/ _jsx("audio", {
                                                className: "",
                                                src: state.detail.logoUrl,
                                                controls: true
                                            })
                                        })
                                    ]
                                }),
                                /*#__PURE__*/ _jsxs("div", {
                                    className: classes.info,
                                    children: [
                                        /*#__PURE__*/ _jsxs("div", {
                                            className: classes.tag_list,
                                            children: [
                                                /*#__PURE__*/ _jsx("div", {
                                                    className: classes.type,
                                                    onClick: function() {
                                                        if (qrOpen) {
                                                            stopQRLoop();
                                                        } else {
                                                            openQR();
                                                        }
                                                    },
                                                    children: /*#__PURE__*/ _jsx("img", {
                                                        src: qrOpen ? require("../../assets/icons/qrPrimary.svg") : matchTheme(theme, {
                                                            dark: require("../../assets/icons/dark/enabledQr.svg"),
                                                            light: require("../../assets/icons/enabledQr.svg")
                                                        })
                                                    })
                                                }),
                                                /*#__PURE__*/ _jsx("div", {
                                                    className: classes.type,
                                                    onClick: function() {
                                                        openMarket();
                                                    },
                                                    children: /*#__PURE__*/ _jsx("img", {
                                                        src: matchTheme(theme, {
                                                            light: require("../../assets/icons/light/marketplace.svg"),
                                                            dark: require("../../assets/icons/dark/marketplace.svg")
                                                        })
                                                    })
                                                }),
                                                /*#__PURE__*/ _jsx("div", {
                                                    onClick: openSendPage,
                                                    className: classNames(classes.type, disabled ? classes.disabled : ""),
                                                    children: /*#__PURE__*/ _jsx("img", {
                                                        src: matchTheme(theme, {
                                                            light: require("../../assets/icons/light/send.svg"),
                                                            dark: require("../../assets/icons/dark/send.svg")
                                                        })
                                                    })
                                                }),
                                                /*#__PURE__*/ _jsx("div", {
                                                    className: classes.type,
                                                    onClick: function() {
                                                        openWWW();
                                                    },
                                                    children: /*#__PURE__*/ _jsx("img", {
                                                        src: matchTheme(theme, {
                                                            light: require("../../assets/icons/light/www.svg"),
                                                            dark: require("../../assets/icons/dark/www.svg")
                                                        })
                                                    })
                                                }),
                                                /*#__PURE__*/ _jsx("div", {
                                                    className: classes.type,
                                                    children: /*#__PURE__*/ _jsx("img", {
                                                        onClick: openBlockChainDetails,
                                                        src: matchTheme(theme, {
                                                            light: require("../../assets/icons/light/infoCircle.svg"),
                                                            dark: require("../../assets/icons/dark/infoCircle.svg")
                                                        })
                                                    })
                                                })
                                            ]
                                        }),
                                        /*#__PURE__*/ _jsxs("div", {
                                            className: classes.description,
                                            children: [
                                                /*#__PURE__*/ _jsx("div", {
                                                    ref: descTextRef,
                                                    className: classes.desc,
                                                    children: state.detail.description
                                                }),
                                                !!((_state_events1 = state.events) === null || _state_events1 === void 0 ? void 0 : _state_events1.length) && /*#__PURE__*/ _jsx(DetailCollapse, {
                                                    title: /*#__PURE__*/ _jsx("div", {
                                                        className: classes.utility_title,
                                                        children: "REWARDS & BENEFITS"
                                                    }),
                                                    children: /*#__PURE__*/ _jsxs("div", {
                                                        className: classes.utility_body,
                                                        children: [
                                                            /*#__PURE__*/ _jsxs("div", {
                                                                className: classes.utility_body_head,
                                                                children: [
                                                                    /*#__PURE__*/ _jsxs("div", {
                                                                        className: classes.utility_body_tabs,
                                                                        children: [
                                                                            /*#__PURE__*/ _jsx("div", {
                                                                                onClick: function() {
                                                                                    state.eventsType = "today";
                                                                                    state.eventsClickedType = true;
                                                                                },
                                                                                className: classNames((_obj = {}, _define_property(_obj, classes.utility_tab, true), _define_property(_obj, classes.utility_tab_active, state.eventsType === "today"), _obj)),
                                                                                children: t(LocalKeyMap.today)
                                                                            }),
                                                                            /*#__PURE__*/ _jsx("div", {
                                                                                onClick: function() {
                                                                                    state.eventsType = "upcoming";
                                                                                    state.eventsClickedType = true;
                                                                                },
                                                                                className: classNames((_obj1 = {}, _define_property(_obj1, classes.utility_tab, true), _define_property(_obj1, classes.utility_tab_active, state.eventsType === "upcoming"), _obj1)),
                                                                                children: t(LocalKeyMap.upcoming)
                                                                            })
                                                                        ]
                                                                    }),
                                                                    userInfo.id && userInfo.id == state.detail.userId && /*#__PURE__*/ _jsx("div", {
                                                                        className: classes.record,
                                                                        onClick: function() {
                                                                            dispatch.app.PUSH({
                                                                                path: "/scanRecord",
                                                                                query: {
                                                                                    tokenId: state.detail.tokenId,
                                                                                    chainType: state.detail.chainType,
                                                                                    contract: state.detail.contract
                                                                                }
                                                                            });
                                                                        },
                                                                        children: /*#__PURE__*/ _jsx("img", {
                                                                            src: matchTheme(theme, {
                                                                                light: require("../../assets/icons/repo.svg"),
                                                                                dark: require("../../assets/icons/dark/repo.svg")
                                                                            })
                                                                        })
                                                                    })
                                                                ]
                                                            }),
                                                            eventList.length ? eventList.map(function(i, key) {
                                                                return /*#__PURE__*/ _jsx(EventCard, _object_spread({
                                                                    eventType: state.eventsType,
                                                                    itemKey: key
                                                                }, i), i.id);
                                                            }) : /*#__PURE__*/ _jsx("div", {
                                                                className: classes.utility_empty,
                                                                children: /*#__PURE__*/ _jsx("span", {
                                                                    children: t(LocalKeyMap.utilityEmpty)
                                                                })
                                                            })
                                                        ]
                                                    })
                                                })
                                            ]
                                        }),
                                        userInfo.id && userInfo.id === state.detail.userId && /*#__PURE__*/ _jsx("div", {
                                            className: classes.option_container
                                        })
                                    ]
                                })
                            ]
                        })
                    }),
                    /*#__PURE__*/ _jsx(Guide, {
                        type: "qrcode",
                        wrapRef: wrapRef.current,
                        scrollDistance: 2000,
                        visible: guideVisible,
                        closeGuide: function() {
                            setGuideVisible(false);
                        }
                    })
                ]
            }),
            state.inputPage && /*#__PURE__*/ _jsx(_Slide, {
                direction: "left",
                unmountOnExit: true,
                children: /*#__PURE__*/ _jsx(SecondaryLayout, {
                    title: t(LocalKeyMap["sendNft.title"]),
                    backFn: back,
                    className: classes.input_page,
                    children: /*#__PURE__*/ _jsx(SendNft, _object_spread_props(_object_spread({}, props, state.detail), {
                        deleteNFT: props.deleteNFT,
                        back: function() {
                            var _props_onBack;
                            (_props_onBack = props.onBack) === null || _props_onBack === void 0 ? void 0 : _props_onBack.call(props);
                        }
                    }))
                })
            })
        ]
    });
}
export default NftDetail;

 //# sourceMappingURL=index.js.map